<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>git命令 | 山鬼说</title><meta name="author" content="gmh"><meta name="copyright" content="gmh"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="git命令 作用 示例    git inin 初始化文件夹为Git仓库    git status 查看仓库状态    git add 文件名 将指定文件添加到暂存区    git  add . 将所有文件添加到暂存区    git rm –cached 文件名 将指定文件从暂存区删除    git reset 清空暂存区文件    git commit -m “提交说明(备注)” 文件名">
<meta property="og:type" content="article">
<meta property="og:title" content="git命令">
<meta property="og:url" content="https://moshangfeng3.gitee.io/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/index.html">
<meta property="og:site_name" content="山鬼说">
<meta property="og:description" content="git命令 作用 示例    git inin 初始化文件夹为Git仓库    git status 查看仓库状态    git add 文件名 将指定文件添加到暂存区    git  add . 将所有文件添加到暂存区    git rm –cached 文件名 将指定文件从暂存区删除    git reset 清空暂存区文件    git commit -m “提交说明(备注)” 文件名">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://moshangfeng3.gitee.io/img/article02.png">
<meta property="article:published_time" content="2022-12-22T02:26:19.316Z">
<meta property="article:modified_time" content="2022-12-22T02:27:56.378Z">
<meta property="article:author" content="gmh">
<meta property="article:tag" content="博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://moshangfeng3.gitee.io/img/article02.png"><link rel="shortcut icon" href="/img/favicon.jpg"><link rel="canonical" href="https://moshangfeng3.gitee.io/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'mediumZoom',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'git命令',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-12-22 10:27:56'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/transpancy.css"><meta name="generator" content="Hexo 5.4.2"></head><body><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pace-js/themes/blue/pace-theme-minimal.min.css"/><script src="https://cdn.jsdelivr.net/npm/pace-js/pace.min.js"></script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">3</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/album/"><i class="fa-fw fas fa-image"></i><span> 图库</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/img/article02.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">山鬼说</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/album/"><i class="fa-fw fas fa-image"></i><span> 图库</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">git命令</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-12-22T02:26:19.316Z" title="发表于 2022-12-22 10:26:19">2022-12-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-12-22T02:27:56.378Z" title="更新于 2022-12-22 10:27:56">2022-12-22</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">296</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>1分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="git命令"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><table>
<thead>
<tr>
<th align="left">git命令</th>
<th>作用</th>
<th>示例</th>
</tr>
</thead>
<tbody><tr>
<td align="left">git inin</td>
<td>初始化文件夹为Git仓库</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010406373.png" alt="1666010406373"></td>
</tr>
<tr>
<td align="left">git status</td>
<td>查看仓库状态</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010515605.png" alt="1666010515605"></td>
</tr>
<tr>
<td align="left">git add 文件名</td>
<td>将指定文件添加到暂存区</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010588076.png" alt="1666010588076"></td>
</tr>
<tr>
<td align="left">git  add .</td>
<td>将所有文件添加到暂存区</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010624230.png" alt="1666010624230"></td>
</tr>
<tr>
<td align="left">git rm –cached 文件名</td>
<td>将指定文件从暂存区删除</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010730890.png" alt="1666010730890"></td>
</tr>
<tr>
<td align="left">git reset</td>
<td>清空暂存区文件</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010763228.png" alt="1666010763228"></td>
</tr>
<tr>
<td align="left">git commit -m “提交说明(备注)” 文件名</td>
<td>从暂存区提交到本地库</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010792934.png" alt="1666010792934"></td>
</tr>
<tr>
<td align="left">git ls-files</td>
<td>查看提交到本地库的文件</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666012727775.png" alt="1666012727775"></td>
</tr>
<tr>
<td align="left">git reflog</td>
<td>查看本地库版本</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010810917.png" alt="1666010810917"></td>
</tr>
<tr>
<td align="left">git log</td>
<td>查看详细日志</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666010823710.png" alt="1666010823710"></td>
</tr>
<tr>
<td align="left">ll</td>
<td>查看当前文件列表</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666011175771.png" alt="1666011175771"></td>
</tr>
<tr>
<td align="left">cat 文件名</td>
<td>查看文件内容</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666011154071.png" alt="1666011154071"></td>
</tr>
<tr>
<td align="left">git reset –hard 版本号</td>
<td>切换版本</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666012340717.png" alt="1666012340717"></td>
</tr>
<tr>
<td align="left">git branch -v</td>
<td>查看分支</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666052229498.png" alt="1666052229498"></td>
</tr>
<tr>
<td align="left">git branch 分支名</td>
<td>创建分支</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666052322830.png" alt="1666052322830"></td>
</tr>
<tr>
<td align="left">git checkout 分支名</td>
<td>切换分支</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666052481059.png" alt="1666052481059"></td>
</tr>
<tr>
<td align="left">git merge 分支名</td>
<td>将目标分支合并到当前所在分支上</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666053757478.png" alt="1666053757478"></td>
</tr>
<tr>
<td align="left">git remote add 远程仓库地址</td>
<td>为远程仓库地址创建别名</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666059316517.png" alt="1666059316517"></td>
</tr>
<tr>
<td align="left">git remote -v</td>
<td>查看已创建的别名</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666059347199.png" alt="1666059347199"></td>
</tr>
<tr>
<td align="left">git push 地址/别名 分支名</td>
<td>推送本地库代码到远程库</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666059547608.png" alt="1666059547608"></td>
</tr>
<tr>
<td align="left">git pull 地址/别名 分支名</td>
<td>拉取远程库代码到本地库</td>
<td><img src="C:\Users\17452\AppData\Roaming\Typora\typora-user-images\1666059995794.png" alt="1666059995794"></td>
</tr>
<tr>
<td align="left">git clone 远程库地址</td>
<td>克隆远程仓库到本地</td>
<td></td>
</tr>
<tr>
<td align="left"></td>
<td></td>
<td></td>
</tr>
<tr>
<td align="left"></td>
<td></td>
<td></td>
</tr>
</tbody></table>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://moshangfeng3.gitee.io">gmh</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://moshangfeng3.gitee.io/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/">https://moshangfeng3.gitee.io/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://moshangfeng3.gitee.io" target="_blank">山鬼说</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="/img/article02.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="next-post pull-full"><a href="/2022/12/22/Redis%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"><img class="next-cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">redis学习笔记（黑马点评）</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div><div id="comment-switch"><span class="first-comment">Valine</span><span class="switch-btn"></span><span class="second-comment">Disqus</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div><div><div id="disqus_thread"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">gmh</div><div class="author-info__description">欢迎访问</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">3</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/moshangf" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:15531132417@163.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://www.douyin.com/" target="_blank" title="TikTok"><i class="fab fa-tiktok"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/" title="git命令"><img src="/img/article02.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="git命令"/></a><div class="content"><a class="title" href="/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/" title="git命令">git命令</a><time datetime="2022-12-22T02:26:19.316Z" title="发表于 2022-12-22 10:26:19">2022-12-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/12/22/Redis%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" title="redis学习笔记（黑马点评）"><img src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="redis学习笔记（黑马点评）"/></a><div class="content"><a class="title" href="/2022/12/22/Redis%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" title="redis学习笔记（黑马点评）">redis学习笔记（黑马点评）</a><time datetime="2022-12-22T02:10:38.553Z" title="发表于 2022-12-22 10:10:38">2022-12-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/12/20/hello-world/" title="Hello World"><img src="/img/article02.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hello World"/></a><div class="content"><a class="title" href="/2022/12/20/hello-world/" title="Hello World">Hello World</a><time datetime="2022-12-20T01:39:18.929Z" title="发表于 2022-12-20 09:39:18">2022-12-20</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/img/article02.png')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By gmh</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="chat_btn" type="button" title="聊天"><i class="fas fa-sms"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'AGqB19pC26bIdMk09n451ohX-gzGzoHsz',
      appKey: 'WrOJF4Y3QBD01eSRswPulrQj',
      avatar: 'monsterid',
      serverURLs: '',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script><script>function loadDisqus () {
  var disqus_config = function () {
    this.page.url = 'https://moshangfeng3.gitee.io/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/'
    this.page.identifier = '/2022/12/22/git%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C/'
    this.page.title = 'git命令'
  };

  window.disqusReset = () => {
    DISQUS.reset({
      reload: true,
      config: disqus_config
    })
  }

  if (window.DISQUS) disqusReset()
  else {
    (function() { 
      var d = document, s = d.createElement('script');
      s.src = 'https://.disqus.com/embed.js';
      s.setAttribute('data-timestamp', +new Date());
      (d.head || d.body).appendChild(s);
    })();
  }

  document.getElementById('darkmode').addEventListener('click', () => {
    setTimeout(() => window.disqusReset(), 200)
  })
}

if ('Valine' === 'Disqus' || !true) {
  if (true) btf.loadComment(document.getElementById('disqus_thread'), loadDisqus)
  else loadDisqus()
} else {
  function loadOtherComment () {
    loadDisqus()
  }
}
</script></div><script>(function(d, w, c) {
    w.ChatraID = 'jis63AyEswca9x2hx';
    var s = d.createElement('script');
    w[c] = w[c] || function() {
        (w[c].q = w[c].q || []).push(arguments);
    };
    s.async = true;
    s.src = 'https://call.chatra.io/chatra.js';
    if (d.head) d.head.appendChild(s);
})(document, window, 'Chatra');

if (true) {
  var chatBtnFn = () => {
    var chatBtn = document.getElementById("chat_btn")
    chatBtn.addEventListener("click", function(){
      Chatra('openChat')
    });
  }
  chatBtnFn()
} else {
  if (true) {
    function chatBtnHide () {
      Chatra('hide')
    }
    function chatBtnShow () {
      Chatra('show')
    }
  }
}</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/metingjs/dist/Meting.min.js"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

  typeof disqusjs === 'object' && disqusjs.destroy()
})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>